home *** CD-ROM | disk | FTP | other *** search
- /* calloc.c p. 128 */
- #include <stdio.h>
- #include <stdlib.h>
- #include <alloc.h>
- char *buffer;
- main()
- {
- buffer = (char *) calloc(100, 80);
- if (buffer == NULL)
- {
-
- printf("Allocation Failed.\n");
- exit(0);
-
- }
- printf("Buffer allocated. Enter string to store: ");
- gets(buffer);
- printf("\nYou entered: %s\n", buffer);
-
- }